<template>
	<view class="wallet-card">
		<image src="../../static/wallet/wallet-bg.png" mode="widthFix"></image>
		<view class="wallet-user">
			<view class="user-info">
				<view>
					<image :src="wallet.heard" mode="aspectFill"></image>
					<view class="user-nick">{{ wallet.nickName }}</view>
				</view>
				<view class="recharge" @tap="recharge">充值</view>
			</view>
			<view class="wallet-info">
				<view class="balance">
					<view class="title">狐狸币</view>
					<view class="total icon iconfont icon-jinbi1">{{ wallet.balance }}</view>
				</view>
				<view v-if="wallet.balance > 5000" class="withdraw" @tap="withdraw">提现</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			wallet:Object
		},methods:{
			recharge(){
				this.$emit('recharge');
			},
			withdraw(){
				this.$emit('withdraw');
			}
		}
	}
</script>

<style lang="less" scoped>
.wallet-card {
	position: relative;
	border-top: 1rpx solid transparent;
	padding: 20rpx 35rpx;
	image {
		vertical-align: middle;
		width: 100%;
	}

	.wallet-user {
		position: absolute;
		top: 45rpx;
		left: 75rpx;
		height: 240rpx;
		width: 80%;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		.user-info {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			& > view:first-child {
				display: flex;
				flex-direction: row;
				align-items: center;
				image {
					width: 100rpx;
					height: 100rpx;
					margin-right: 10rpx;
					border-radius: 50%;
				}
				view {
					font-weight: 500;
					color: #ffffff;
					font-size: 28rpx;
				}
			}

			.recharge {
				padding: 0 25rpx;
				border: 1rpx solid #ffffff;
				font-size: 32rpx;
				font-weight: 500;
				color: #ffffff;
				border-radius: 8rpx;
				background: #f86090;
			}
		}

		.wallet-info {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			.balance {
				.title {
					color: #ffe8ee;
					font-size: 24rpx;
				}

				.total {
					font-weight: 600;
					color: #ffe8ee;
					font-size: 36rpx;
				}
				.icon-jinbi1::before {
					margin-right: 5rpx;
				}
			}
			.withdraw {
				padding: 0 25rpx;
				border: 1rpx solid #ffffff;
				font-size: 32rpx;
				font-weight: 500;
				color: #ffffff;
				border-radius: 8rpx;
				background: #d9d9d9;
			}
		}
	}
}
</style>
